package cn.tedu.toa.management.sys.mapper;

import cn.tedu.toa.management.sys.entity.FNews;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 新闻 Mapper 接口
 * </p>
 *
 * @author huaqian
 * @since 2021-10-02
 */
public interface FNewsMapper extends BaseMapper<FNews> {

    List<FNews> selectNewsList(String name);

    //修改
    @Update("update f_news set type=#{type},title=#{title}," +
            "summary=#{summary},content=#{content}," +
            "modifyusername=#{modifyusername},modifytime=#{modifytime} where id=#{id}")
    int update(
            @Param("type")Integer type, @Param("title")String title,
            @Param("summary")String summary, @Param("content")String content,
            @Param("modifyusername")String modifyusername, @Param("modifytime") LocalDateTime modifytime,
            @Param("id")Integer id);
}
